package com.example.demo.utils


class JsonResult {
    var status: Int? = null
    var msg: String? = null
    var data: Any? = null

    constructor(status: Int?, msg: String?, data: Any?) {
        this.status = status
        this.msg = msg
        this.data = data
    }

    companion object {
        fun success(msg: String = "操作成功", data: Any? = null): JsonResult {
            return JsonResult(200, msg, data)
        }

        fun fail(msg: String = "操作失败", data: Any? = null): JsonResult {
            return JsonResult(-1, msg, data)
        }
    }
}